package etnorservice.etnor_service.mapper.projectMapper;



import etnorservice.etnor_service.domain.ProjectFeature;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProjectFeatureMapper {
    @Insert("INSERT INTO project_features(project_id, feature_title, feature_description, display_order) " +
            "VALUES(#{projectId}, #{featureTitle}, #{featureDescription}, #{displayOrder})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insert(ProjectFeature feature);

    @Select("SELECT * FROM project_features WHERE project_id = #{projectId} ORDER BY display_order")
    List<ProjectFeature> findByProjectId(Long projectId);

    @Delete("DELETE FROM project_features WHERE project_id = #{projectId}")
    int deleteByProjectId(Long projectId);
}